import React, { memo, useEffect } from "react";
import { useRoutes } from "react-router-dom";

import Routes from "@/router/index.js";
import AppHeader from "../conptonents/app-header";
import AppFooter from "../conptonents/app-footer";
import { Affix } from "antd";

const App = memo(() => {
  useEffect(() => {
    const getData = async () => {
      // const result = await Request.get({ url: "/home/highscore" });
      // console.log(result);
    };
    getData();
  }, []);

  return (
    <React.Fragment>
      <Affix>
        <AppHeader offsetTop={0} />
      </Affix>
      <div className="">{useRoutes(Routes)}</div>
      <AppFooter />
    </React.Fragment>
  );
});

export default App;
